/*
 * Copyright 2009 Gary Brown
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *
 * Change History:
 * 14 Mar 2009 : Initial version created by gary
 */
package org.betonthemove.platform.betfair;

import org.betonthemove.platform.Bet;

public class BetItem implements Bet {

	public long getBetId() {
		return(betId);
	}
	
	public int getEntrantId() {
		return(selectionId);
	}
	
	public void setEntrantName(String name) {
		entrantName = name;
	}
	
	public String getEntrantName() {
		return(entrantName);
	}
	
	public int getMarketId() {
		return(marketId);
	}
	
	public void setMarketName(String name) {
		marketName = name;
	}
	
	public String getMarketName() {
		return(marketName);
	}
	
	public double getOdds() {
		return(price);
	}
	
	public double getStake() {
		return(size);
	}
	
	public boolean isBack() {
		return(betType != null && betType.equals("B"));
	}

	public boolean isMatched() {
		return(betStatus != null && betStatus.equals("M"));
	}

	public String toString() {
		String ret="BET[id="+getBetId()+" market="+getMarketId()+
					"["+marketName+"]"+
					" entrant="+getEntrantId()+
					"["+entrantName+"]"+
					" stake="+getStake()+
					" odds="+getOdds()+" isBack="+
					isBack()+" isMatched="+isMatched()+"]";
		
		return(ret);
	}
		
	private int asianLineId=0;
	private long betId=0;
	private long transactionId=0;
	private String betStatus=null;
	private String betType=null;
	private String betCategoryType=null;
	private String betPersistenceType=null;
	private int marketId=0;
	private String matchedDate=null;
	private double size=0;
	private double bspLiability=0;
	private String placedDate=null;
	private double price=0;
	private int selectionId=0;
	private double handicap=0;
	private String entrantName=null;
	private String marketName=null;
}
